<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>

    var imgPath;
    var ajax=new XMLHttpRequest();

    var imgPathReg=/src="(.*?[\.jpg|\.png|\.gif])"/img;
    ajax.open("get","./1.txt");
    ajax.send();
    ajax.onreadystatechange=function () {
        if(ajax.readyState==4){
            if(ajax.status==200){
                var data=ajax.responseText;
                while (imgPath=imgPathReg.exec(data)){
                    console.log(imgPath[1])
                }



            }
        }
    }
</script>
</html>